package ltd.itlover.yqblog.application;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.StrictMode;


import androidx.annotation.RequiresApi;

import org.litepal.LitePal;


import dagger.hilt.android.HiltAndroidApp;

@HiltAndroidApp
public class MyApplication extends Application {
    public static Context context;
    public static String imgHost = "https://www.itlover.ltd";
    public static String token = "";

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        LitePal.initialize(this);

        StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
        StrictMode.setVmPolicy(builder.build());
        builder.detectFileUriExposure();

    }



    public static Context getContext(){
        return context;
    }

    public static String getImgHost(){
        return imgHost;
    }

    public static String getToken() {
        return token;
    }

    public static void setToken(String token) {
        MyApplication.token = token;
    }
}
